#include "card.h"
#include "cardQLabel.h"
#include "labeledCard.h"
#include <QDebug>
#include "mainwindow.h"

LabeledCard::LabeledCard(LabeledCard&& x):card(x.card),parent(x.parent),label(x.label){
    label->card=this;
    x.label=nullptr;
    index=x.index;
}

LabeledCard::~LabeledCard(){
    delete label;
}

void LabeledCard::init(){
    label = new CardQLabel(parent);
    label->card=this;
    label->setStyleSheet("background-color:rgba(255,255,255,1);font-size:40px;"
                         "vertical-align:top;text-align:left;border-color:rgba(0,0,0,1);"
                         "border-radius:5px;border-width:2px;border-style: solid;");
    label->hide();
}

void LabeledCard::dealMouseEvent(){
    selected=!selected;
    parent->reshowCard(index);
}

void LabeledCard::setUnmovable(){
    label->is_dizhu_card=true;
}
